{include file="public/header"/}
{page:location}
{page:pos label="管理员管理" link="admin/admins/lists"/}
{page:pos label="管理员列表"}
{/page:location}
<div id="container">
    {page:header title="管理员列表" group="$group"}
    <a href="{:url('add')}" class="am-btn am-btn-xs am-btn-primary" data-pjax><i class="am-icon-plus"></i> 添加管理员</a>
    {/page:header}

    {page:search /}

    <table class="page-table am-table am-table-bordered am-table-striped am-table-hover am-table-compact am-text-nowrap am-margin-bottom-xs am-table-centered">
        <thead>
        <tr>
            <th>ID</th>
            <th>用户名</th>
            <th>真实姓名</th>
            <th>性别</th>
            <th>手机号</th>
            <th>E-mail</th>
            <th>最后登录IP</th>
            <th>最后登录时间</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach $lists as $row}
        <tr>
            <td>{$row:id}</td>
            <td>{$row:username}</td>
            <td>{$row:realname}</td>
            <td>{$row:gender_text}</td>
            <td>{$row:mobile}</td>
            <td>{$row:email}</td>
            <td>{$row:last_ip}</td>
            <td>{$row:last_time|f_date=###}</td>
            <td><span class="am-text-{$row:status==1?'success':'warning'}">{$row:status_text}</span></td>
            <td>
                {if $Request.get.group == 'recycle'}
                <a href="{:url('restore', ['id' => $row->id])}" class="am-badge am-badge-danger" data-confirm="您确认要恢复 [{$row:realname}] 管理员吗?">
                    <i class="am-icon-repeat"></i> 还原
                </a>
                <a href="{:url('delete', ['id' => $row->id])}" class="am-badge am-badge-danger" data-confirm="您确认要彻底删除 [{$row:realname}] 管理员吗?">
                    <i class="am-icon-remove"></i> 彻底删除
                </a>
                {else/}
                {if $row->id != 1 || $admin['id'] == $row->id}
                <a href="{:url('edit', ['id' => $row->id])}" class="am-badge am-badge-primary" data-pjax>
                    <i class="am-icon-edit"></i> 编辑
                </a>
                {/if}
                {if $row->id != 1 && $admin['id'] != $row->id}
                <a href="{:url('recycle', ['id' => $row->id])}" class="am-badge am-badge-danger" data-confirm="您确认要将管理员 [{$row:realname}] 移到回收站吗?">
                    <i class="am-icon-recycle"></i> 删除
                </a>
                {/if}
                {/if}
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {page:paging /}
</div>
{include file="public/footer"/}